package com.usian.service.impl;

import com.usian.mapper.AdssqMapper;
import com.usian.pojo.Adssq;
import com.usian.result.Result;
import com.usian.service.AdssqService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

@Service
public class AdssqServiceImpl implements AdssqService{
    @Autowired
    private AdssqMapper adssqMapper;

    @Override
    public Result FindByAdssq(Integer id) {
        if (id == null){
            throw new RuntimeException("失败");
        }
        Example example =new Example(Adssq.class);
        example.createCriteria().andEqualTo("parentId",id);
        List<Adssq> list = adssqMapper.selectByExample(example);
        return new Result(list);
    }
}
